import request from '@/utils/request'

// 项目用户相关的请求地址
enum API {
  ADMINGETALLUSER_URL = '/admin/GetAllUser',
  ADMINUPDATEUSER_URL = '/admin/updateUser',
  ADMINGETALLAUTHORITY_URL = '/admin/GetALLAuthority',
  ADMINUPDATEUSERAUTHORITY_URL = '/admin/updateUserAuthority',
  ADMINGETALLSCHOOL_URL = '/admin/GetALLSchool',
  ADMINADDSCHOOL_URL = '/admin/addSchool',
  ADMINDELSCHOOL_URL = '/admin/delSchool',
  ADMINGETTEACHER_URL = '/admin/getTeacher',
  ADMINUPDATECLASS_URL = '/admin/updateclass',
  ADMINUPDATEMODULE_URL = '/admin/updatemodule',
  ADMINADDTEACHER_URL = '/admin/addTeacher',
}

// 管理员获取全部用户信息
export const reqAdminGetAllUser = (data: any) => request.post(API.ADMINGETALLUSER_URL, data)

// 管理员更新用户信息
export const reqAdminUpdateUser = (data: any) => request.post(API.ADMINUPDATEUSER_URL, data)

// 管理员获取权限表
export const reqAdminGetAllAuthority = (data: any) =>
  request.post(API.ADMINGETALLAUTHORITY_URL, data)

// 管理员修改用户权限
export const reqAdminUpdateUserAuthority = (data: any) =>
  request.post(API.ADMINUPDATEUSERAUTHORITY_URL, data)

// 管理员获取课程表
export const reqAdminGetAllSchool = (data: any) => request.post(API.ADMINGETALLSCHOOL_URL, data)

// 管理员添加课程
export const reqAddSchool = (data: any) => request.post(API.ADMINADDSCHOOL_URL, data)

// 管理员删除课程
export const reqDelSchool = (data: any) => request.post(API.ADMINDELSCHOOL_URL, data)

// 管理员获取全部教师
export const reqAdminGetAllTeacher = () => request.get(API.ADMINGETTEACHER_URL)

// 管理员更改教师选课权限
export const reqAdminChangeTeacherLimit = (data: any) =>
  request.post(API.ADMINUPDATECLASS_URL, data)

// 管理员更改教师模型权限
export const reqAdminChangeTeacherModel = (data: any) =>
  request.post(API.ADMINUPDATEMODULE_URL, data)

// 管理员添加教师
export const reqAdminAddTeacher = (data: any) => request.post(API.ADMINADDTEACHER_URL, data)
